#ifndef GLSLSHADER
#define GLSLSHADER

//#define GL_GLEXT_PROTOTYPES 1

#ifdef WIN32
#include <Windows.h>
#endif

#include <GL/glew.h>
#include "shader.h"

class GlslShader : public Shader {
public:
	GlslShader();
	GlslShader(const char *VShader, const char *PShader);
	~GlslShader();

	void Load(const char *VShader, const char *PShader);
	void Enable();
	void Disable();

	void DisplayGPUinfo();
	const GLhandleARB GetHandle(void) const {return m_Program;};

	void SetUniform(const char *name, float x=0.0, float y=0.0, float z=0.0, float w=0.0) ;
	void SetUniform(const char *name,int x=0,int y=0,int z=0,int w=0) ;
	void SetUniform(const char *name,float *v) ;
	void SetUniform(const char *name,int *i) ;

private:
	void Init();
	GLhandleARB LoadProgram(const char*, GLenum);
	bool WriteError(GLhandleARB);
	bool m_Initialized;
	bool m_Enabled;
	GLhandleARB m_Program;
	static bool extensions_checked;
	static GLhandleARB activeShader;
};

#endif
